import type { ComponentPublicInstance, ExtractPropTypes, PropType } from "vue";

export const hitProductListProps = {
  products: {
    type: Array as PropType<API.BOX.BoxProduceItem[]>,
    default: () => [],
  },
  isMobile: {
    type: Boolean,
    default: false,
  },
};

export const hitProductListEmits = {
  start: () => true,
  end: () => true,
  tick: (idx: number) => typeof idx,
};

export type HitProductListProps = ExtractPropTypes<typeof hitProductListProps>;
export type HitProductListExpose = {
  startSpin: (
    hitProducts: API.BOX.BoxProduceItem[],
    selectIdx: number,
    callback?: () => void
  ) => void;
};

export type HitProductListInstance = ComponentPublicInstance<
  HitProductListExpose,
  HitProductListProps
>;
